<?php
/**
 * @author 	 	 faithsmine@gmail.com
 * @copyright	         www
 * @version		 1.0
 * @name 		 index.php
 * @todo 		 后台管理控制处理
 * @final 		 2009-12-10
 */
define('IN_YCTOOL', true);//定义该文件合法性
require_once('../config.php');
require_once('../config2.php');
require_once(DIR_COMM . 'common.php');
$user->isLogin('../');
$role = $user->userinfo['roles'];
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>红日春天后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<style type="text/css">
{
	WORD-WRAP: break-word; outline: none
}
BODY {
	BACKGROUND: #fff; TEXT-ALIGN: center;MARGIN: 0px;
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
	FONT: 12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; COLOR: #555
}
TD {
	FONT: 12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; COLOR: #555
}
INPUT {
	FONT: 12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; COLOR: #555
}
BUTTON {
	FONT: 12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; COLOR: #555
}
UL {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
P {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
EM {
	FONT-WEIGHT: normal; FONT-STYLE: normal
}

FORM {
	PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
UL {
	LIST-STYLE-TYPE: none
}
A {
	COLOR: #2366a8; TEXT-DECORATION: none
}
A:hover {
	TEXT-DECORATION: underline
}
A IMG {
	BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none
}
TABLE {
	BORDER-COLLAPSE: collapse
}
TH {
	TEXT-ALIGN: left
}
LABEL {
	CURSOR: pointer
}
INPUT {
	 margin-top:5;BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #666 1px solid; PADDING-LEFT: 2px; BACKGROUND: #f9f9f9; PADDING-BOTTOM: 0px; BORDER-LEFT: #666 1px solid; COLOR: #333; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid
}
#admintop {
	BACKGROUND: #fff;
	border-bottom:solid #318A00;
}
.mainhd {
	OVERFLOW: hidden; LINE-HEIGHT: 45px; POSITION: relative; HEIGHT: 45px; TEXT-ALIGN: left
}
.logo {
	FLOAT: left;BACKGROUND: url(image/logo.gif) no-repeat 10px 5px; WIDTH: 55px; HEIGHT: 45px
}
.uinfo {
	FLOAT: left; margin-top:20px;
}
.clearcache {
	Z-INDEX: 3; right: 0px; WIDTH: 190; POSITION: absolute; TOP: 14px; HEIGHT: 40px;background-color:#fff;
}
.nav {
	Z-INDEX: 2; LEFT: 10px; WIDTH: 100%; POSITION: absolute; TOP: 14px; HEIGHT: 40px;background-color:#fff;
}
.nav UL {
	FONT-SIZE: 14px; Z-INDEX: 4; OVERFLOW: hidden; POSITION: relative
}
.nav LI {
	FLOAT: left; LINE-HEIGHT: 36px; HEIGHT: 40px;BACKGROUND: url(image/t2.gif) no-repeat right;
}
.nav LI EM {
	DISPLAY: block
}
.nav LI A {
	PADDING-RIGHT: 12px; PADDING-LEFT: 12px; FONT-WEIGHT: 700; PADDING-BOTTOM: 5px; COLOR: #639bb0; PADDING-TOP: 5px
}
.nav LI A:hover {
	COLOR: #09c; TEXT-DECORATION: none
}
.nav LI .diffcolor {
	COLOR: #f60
}
.nav LI.navon {
	BACKGROUND: url(image/login_header.gif); LINE-HEIGHT: 32px
}
.nav LI.navon EM {
	DISPLAY: block; BACKGROUND: url(image/login_header.gif) 
}
.nav LI.navon EM A {
	DISPLAY: block; BACKGROUND: url(image/login_header.gif); COLOR: #fff
}
.nav LI.navon EM A:hover {
	COLOR: #fff
}

.menutd {
	BACKGROUND: url(image/t3.gif) #f2f9fd no-repeat right top
}
.menu {
	Z-INDEX: 20; WIDTH: 160px; POSITION: relative
}
.menu UL {
	RIGHT: 5px;WIDTH: 153px; LIST-STYLE-TYPE: none; POSITION: absolute; TOP: 10px
}
.menu LI {
	MARGIN: 0px; OVERFLOW: hidden; HEIGHT: 25px
}
.menu LI A {
	PADDING-RIGHT: 0px; DISPLAY: block; PADDING-LEFT: 30px; BACKGROUND: url(image/bg_repno.gif) no-repeat; PADDING-BOTTOM: 3px; COLOR: #666; PADDING-TOP: 5px
}
.menu LI A:hover {
	BACKGROUND:#94cf6b; COLOR: #ffffff; TEXT-DECORATION: none
}
.menu LI A.tabon {
	background:#52ba10; COLOR: #ffffff; TEXT-DECORATION: none
}
.menu LI A.tabon:hover {
	BACKGROUND: #94cf6b; COLOR: #ffffff; TEXT-DECORATION: none
}
.copyright {
	BORDER-TOP: #ddd 1px dashed;
	FONT-SIZE: 11px;
	Z-INDEX: 10;
	LEFT: 5px;
	BOTTOM: 3px;
	LINE-HEIGHT: 150%;
	PADDING-TOP: 3px;
	FONT-FAMILY: Tahoma;
	POSITION: absolute;
	TEXT-ALIGN: center;
	width: 137px;
}
</style>
<script type="text/javascript">
function clearCache()
{
    alert(0);
}
</script>
</HEAD>
<BODY scroll=no>
<DIV id=append_parent></DIV>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%">
  
    <TR id="admintop">
      <TD vAlign=top width=160 height=40><DIV class=logo></DIV>
        <DIV class=uinfo>
		<A href="http://www.jiaju001.com" 
		  target=_blank>网站首页</A> [<A  href="../login.php?action=logout" 
		  target=_top>退出</A>] </DIV></TD>
      <TD vAlign=top width="100%"><DIV class=mainhd>
          <DIV class=nav>
            <UL id=topmenu>
              <LI><EM><A id=header_global hideFocus 
        onclick="toggleMenu('global', 'help');" 
        href="javascript:;">站点</A></EM></LI>
        <?php if ($role == 1)
                {?>
              <LI><EM><A id=header_user hideFocus 
        onclick="toggleMenu('user', 'list&amp;operation=user');" 
        href="javascript:;">用户管理</A></EM></LI>
        <?php } ?>
              <LI><EM><A id=header_pros hideFocus 
        onclick="toggleMenu('pros', 'list&amp;operation=products&amp;type=2');"
        href="javascript:;">产品管理</A></EM></LI>
		
            </UL>
          </DIV>
          <DIV class="clearcache">
<a href="#" onclick="clearCache()">清除缓存</a>
<a href="#" onclick="history.back()">返回</a>
            <!--FORM name=search action=admin.php?action=search method=post 
			  target=main>
              <INPUT class=txt name=keywords>
              <INPUT class=btn type=hidden  value=yes name=searchsubmit>
              <INPUT class=btn type=submit value=搜索 name=searchsubmit>
            </FORM-->
          </DIV>
        </DIV></TD>
    </TR>
    <TR>
      <TD height="2" colspan="2" bgcolor="#318A00"></TD>
    </TR>
    <TR>
      <TD class=menutd vAlign=top width=160>
	  <DIV class=menu id=leftmenu>
          <UL id=menu_global style="DISPLAY: none">
		<?php 
		if ($typearray)
		{
			foreach($typearray as $key => $item)
                        {
                            if ($key == 1)
                            {
			    ?>
		<LI><A hideFocus 
        href="admin.php?action=list&amp;operation=<?php echo $typearray1[$key];?>&amp;type=<?php echo $key; ?>" onClick="focusMenu(this);"
        target=main><?php echo $item; ?>列表</A></LI>				
             <LI><A hideFocus 
        href="admin.php?action=post&amp;operation=<?php echo $typearray1[$key];?>&amp;type=<?php echo $key; ?>" onClick="focusMenu(this);"
        target=main><?php echo $item; ?>发布</A></LI>
			    <?php
                            }
                        }
		}
		?>
            <LI><A hideFocus onClick="focusMenu(this);"
        href="admin.php?action=roles&amp;operation=cell" 
        target=main>权限设置</A></LI>
            <LI><A hideFocus onClick="focusMenu(this);"
        href="../user.php?action=data&dataget=psw" 
        target=_blank>修改密码</A></LI>
            <LI><A hideFocus onClick="focusMenu(this);" href="admin.php?action=help" 
        target=main>后台帮助</A></LI>
          </UL>

          <UL id=menu_user style="DISPLAY: none">
            <LI><A hideFocus onClick="focusMenu(this);"
        href="admin.php?action=list&amp;operation=user" 
        target=main>用户列表</A></LI>
 
          <!--   <LI><A hideFocus onClick="focusMenu(this);"
        href="admin.php?action=roles&amp;operation=group" 
        target=main>用户组设置</A></LI> --!>
          </UL>
          <UL id=menu_pros style="DISPLAY: none">
		<?php 
		if ($typearray)
		{
			foreach($typearray as $key => $item)
                        {
                            if ($key > 1 && $key < 5)
                            {
			    ?>
		<LI><A hideFocus onClick="focusMenu(this);"
        href="admin.php?action=list&amp;operation=<?php echo $typearray1[$key];?>&amp;type=<?php echo $key; ?>" 
        target=main><?php echo $item; ?>列表</A></LI>				
             <LI><A hideFocus onClick="focusMenu(this);"
        href="admin.php?action=post&amp;operation=<?php echo $typearray1[$key];?>&amp;type=<?php echo $key; ?>"  
        target=main><?php echo $item; ?>发布</A></LI>
			    <?php
                            }
                        }
		}
		?>
            </UL>	
        </DIV></TD>
      <TD class=mask vAlign=top width="100%"><IFRAME style="OVERFLOW: visible" 
      name=main src="admin.php" 
      frameBorder=0 width="100%" scrolling=yes 
  height="100%"></IFRAME></TD>
    </TR>
  
</TABLE>
<DIV class=copyright><!--../user.php?uid= --!>
  <P><A href="<?php // echo $user->userinfo['userid'];?>" target=_blank><?php echo $user->userinfo['username'];?></A></P>
  <P><A href="mailto:faithsmine@gmail.com" target=_blank>faithsmine</A> Development</P>
</DIV>
<script type="text/JavaScript">
	//需要配置的地方
	var headers = new Array('global', 'user', 'pros');
	var adminfilename = 'admin.php';
	var adminfileaction = '?action=';
	//需要配置的地方
	var adminfile = adminfilename + adminfileaction;
	var adminfilelengh = adminfile.length;
        function toggleMenu(key, url) {

		for(var k in headers) {
			tk = document.getElementById('menu_' + headers[k]);
			if(tk) {
				tk.style.display = headers[k] == key ? '' : 'none';
			}
		}
		
		var lis = document.getElementById('topmenu').getElementsByTagName('li');
		for(var i = 0; i < lis.length; i++) {
			if(lis[i].className == 'navon') lis[i].className = '';
		}

		document.getElementById('header_' + key).parentNode.parentNode.className = 'navon';
		
		if(url) {
			parent.main.location = adminfilename + adminfileaction + url;
			
			var hrefs = document.getElementById('menu_' + key).getElementsByTagName('a');
			
			for(var j = 0; j < hrefs.length; j++) {
				hrefs[j].className = hrefs[j].href.substr(hrefs[j].href.indexOf(adminfilename + adminfileaction) + adminfilelengh) == url ? 'tabon' : (hrefs[j].className == 'tabon' ? '' : hrefs[j].className);
			}
		}
		return false;
	}
	toggleMenu('global', 'help');
	function focusMenu(key)
	{
		var hrefs = document.getElementById('leftmenu').getElementsByTagName('a');
		for(var j = 0; j < hrefs.length; j++)
		{
			hrefs[j].className = hrefs[j] == key ? 'tabon' : (hrefs[j].className == 'tabon' ? '' : hrefs[j].className);
		}
		return false;
	}
</script>
</body>
</html>
